In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline

from smarts import *
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

from pypvcell.illumination import Illumination


/Users/kanhua/Dropbox/Programming/python_distribution_try/pypvcell_p3_lw/lib/python3.5/site-packages/matplotlib/cbook.py:128: MatplotlibDeprecationWarning: The finance module has been deprecated in mpl 2.0 and will be removed in mpl 2.2. Please use the matplotlib toolkit finance instead.
  warnings.warn(message, mplDeprecation, stacklevel=1)

Load the default setting. This setting is identical to Example 6 except that this setting adds a filter in order to remove the error message.


In [2]:
file = build_smarts_file(
    **astmg_173_03_m 
)   

data = send_to_smarts(file)

plt.plot(data.iloc[:,0],data.iloc[:,1],hold=True)
plt.plot(data.iloc[:,0],data.iloc[:,4])
plt.show()



In [3]:
data.columns


Out[3]:
Index(['WVLGTH', 'ET_SPCTRUM', 'BEAM_NORMAL', 'BEAM_NORM+', 'GLOB_HORIZ',
       'GLOBL_TILT'],
      dtype='object')

Compare the results between standard AM1.5d and the SMARTS-generated spectrum


In [4]:
ill=Illumination("AM1.5d")
x,y=ill.get_spectrum("nm")
plt.plot(x,y,hold=True,label="AM1.5d")
plt.plot(data['WVLGTH'],data['BEAM_NORM+'],hold=True,label="SMART")


Out[4]:
[<matplotlib.lines.Line2D at 0x1127bfa90>]

In [5]:
ill_g=Illumination("AM1.5g")
x,y=ill_g.get_spectrum("nm")
plt.plot(x,y,hold=True,label="AM1.5g")
plt.plot(data['WVLGTH'],data['GLOBL_TILT'],hold=True,label="SMART")


Out[5]:
[<matplotlib.lines.Line2D at 0x1128a0c88>]

In [6]:
data=get_astm_airmass(1.5)
plt.plot(x,y,hold=True,label="AM1.5g")
plt.plot(data['WVLGTH'],data['GLOBL_TILT'],hold=True,label="SMART")


Out[6]:
[<matplotlib.lines.Line2D at 0x11293d208>]

In [7]:
amass=np.linspace(0.5,3,num=10)
for a in amass:
    data=get_astm_airmass(a)
    plt.plot(data['WVLGTH'],data['GLOBL_TILT'],hold=True,label='%s'%a)



In [8]:
amass=np.linspace(0.5,3,num=10)
for a in amass:
    data=get_astm_airmass(a)
    plt.plot(data['WVLGTH'],data['GLOB_HORIZ'],hold=True,label='%s'%a)



In [9]:
data.columns


Out[9]:
Index(['WVLGTH', 'ET_SPCTRUM', 'BEAM_NORMAL', 'BEAM_NORM+', 'GLOB_HORIZ',
       'GLOBL_TILT'],
      dtype='object')